<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>


        // 
        var obj = {
            name: 'cc',
            age: 18,
            say: function () {
                console.log('hello world');
            }
        }

        console.log(obj.name);
        console.log(obj['name']);

        obj.say();

        obj['say']();

        var arr = [];

        // arr.push(1);

        arr['push'](1);

        console.log(arr);


        // 对象的遍历   for in

        for(var key in obj) {
            console.log(obj[key]) ;
        }


        // 数组的遍历   for of     for     forEach    for in 
        //     for in 在遍历数组的时候，有bug   


        // 建议
        //    for in   遍历对象
        //    for   forEach  遍历数组


    </script>

</body>

</html>